#!/bin/sh
cd `dirname $0`
pwd

install_source ()
{
	if [[ $1 == '' ]]; then
		if [[ $text_withoutblack == '' ]]; then
			reture
		fi
	fi

	echo $1
	ext_source_path=`echo $1 | awk  '{print $1}'`
	ext_source_repo_branch=`echo $1 | awk  '{print $2}'`
	ext_source_repo_path=`echo $1| awk  '{print $3}'`
	echo $ext_source_path
	echo $ext_source_repo_branch
	echo $ext_source_repo_path
	if [[ ! -d $ext_source_path ]]; then
		git clone -b $ext_source_repo_branch $ext_source_repo_path
		echo "${ext_source_path} is cloned"
	fi
}

cat external_sources | while read line
do
	if [[ -n $line ]]; then
		install_source "${line}"
	fi
done
pod install --verbose --no-repo-update